home *** CD-ROM | disk | FTP | other *** search
/ The X-Philes (2nd Revision) / The X-Philes Number 1 (1995).iso / xphiles / hp48_1 / nrts.v05 < prev    next >
Text File  |  1995-03-23  |  52KB  |  1,644 lines

  1. NRTS ver. 0.5
  2. HP48sx dumb terminal program
  3. Bill Gribble
  4.  
  5.  
  6. I. Introduction
  7.  
  8. This is the first release version of NRTS, a dumb terminal program.  After   
  9.   fairly extensive betatesting I feel it's ready for general distribution.
  10.   NRTS has about the functionality of other currently available terminal
  11.   programs; that is, it doesn't process escape sequences and processes
  12.   only a few control characters.  Its fundamental advantage is speed.  The
  13.   bulk of the program is written in machine code, interspersed with RPL
  14.   threads where I needed them, and is quite quick.  Also, NRTS has at least
  15.   one feature that's different and, I think, sort of neat: the function
  16.   keys, which I'll talk about later.
  17.  
  18. You may notice that the version number of this release is 0.5; I am still
  19.   working on an ANSI code parser that will make NRTS a "real" terminal
  20.   emulator, and hopefully allow anyone who feels the need to run an 8x22
  21.   EMACS session :-)  That version will be 1.0, since I don't think the 
  22.   program's finished until it has escape code processing.
  23.  
  24. NRTS is enclosed as an ASC'ed directory containing the program and the 
  25.   FKEYS function key list with some sample function keys.  I don't have
  26.   real documentation produced, but I will try to make this text thorough
  27.   enough to make do.
  28.  
  29. II.  General information.
  30.  
  31. As mentioned before, NRTS uses an 8x22 text display screen.  It uses a 
  32.   subset of the HP48's medium font including only the characters from
  33.   ASCII 32 thru 127.  Control characters are all processed, meaning they
  34.   aren't displayed as those irritating little squares.  Escape sequences
  35.   appear as text.  
  36.   
  37. Each key on the keyboard has up to four assignments: unshifted, blue-shifted,
  38.   orange-shifted, and alpha-shifted.  As a rule, unshifted = lowercase
  39.   alpha, blue-shifted = uppercase alpha, orange-shifted = control, and 
  40.   alpha-shifted are program control and function keys.  Complete keymaps
  41.   follow in their own section.  Unfortunately, in the interests of speed 
  42.   the key assignments are built in the program in a lookup table.  They 
  43.   are easy to change in the source, but difficult once the program is 
  44.   compiled.  This may change in a later version, but for now send me your
  45.   key suggestions and I'll try to improve the keyboard as versions go by.
  46.   The shift- alpha-keys work a little differently.  Hitting alpha or
  47.   orange-shift causes the appropriate annunciator to be displayed and 
  48.   the NEXT keystroke is shifted that way, unless the same (shift or alpha)
  49.   key is hit again, in which case the annunciator goes off and the keyboard
  50.   is returned to itsw unshifted state.  Blue shift, if hit once,
  51.   causes the blue-shifted keyboard to appear for one keystroke, but hitting 
  52.   it again causes the annunciator to stay on and shift to be locked until 
  53.   the next time blue-shift is hit.  Make sense?  Fool around with it and
  54.   you'll see.
  55.  
  56. Kermit file transfer is implemented in a limited way.  Alpha-R starts 
  57.   kermit receive, but send is not well-implemented since I couldn't include
  58.   an effective file selector.  Alpha-S starts kermit send but is bound to
  59.   cause an error unless you've used a function key or something else 
  60.   clever to put a file name on the stack.  This will be improved in
  61.   later versions.
  62.  
  63. The function keys are the alpha-shifted "big keys" 789/456*123-0 .+.  
  64.   Pressing one of them evaluates the corresponding element in the list
  65.   FKEYS, going upper-right to lower-left - '7' corresponds to list element
  66.   1, '8' to element 2 ... '-' to element 12, and so on down to '+' evaluating
  67.   element 16.  I think the example function keys give a crude idea of what
  68.   is possible.  Any sort of program that doesn't require arguments from the 
  69.   stack and doesn't leave any behind is o.k. to put in FKEYS.  Since I use 
  70.   the stack/menu grobs for graphics, don't expect anything with PICT to
  71.   perform as expected, although it might.  Use DISP if you want to write to 
  72.   the screen.  Future releases may include phonebooks, file browsers, etc. 
  73.   in fkeys.
  74.  
  75. Alpha keys summary:
  76.  
  77.   B:  sends serial break
  78.   C:  toggles between cr and cr/lf for received CR (just cr is default)
  79.   Q:  quit NRTS
  80.   R:  start Kermit receive
  81.   S:  start Kermit send (see note above)
  82.  
  83. III.  Keyboard layout
  84.  
  85. Unshifted keyboard:
  86.                  (screen)
  87.      | |_____________________________| |
  88.      |   a    b    c    d    e    f    |
  89.      |   g    h    i    j    k    l    |
  90.      |   m    n    o    p    q    r    |
  91.      |   s    t    u    v    w    x    |
  92.      |   < cr >    y    z   del   bs   |
  93.      |  alf    7     8     9     /     |
  94.      |  ctl    4     5     6     *     |
  95.      |  shf    1     2     3     -     |
  96.      |  on     0     .    spc    +     |
  97.      +---------------------------------+
  98.  
  99. Blue-shifted keyboard: 
  100.                   (screen)
  101.      |  |____________________________| |
  102.      |   A    B    C    D    E    F    |
  103.      |   G    H    I    J    K    L    |
  104.      |   M    N    O    P    Q    R    |
  105.      |   S    T    U    V    W    X    |
  106.      |   < cr >    Y    Z   del   bs   |
  107.      |  alf    &     *     (     ~     |
  108.      |  ctl    $     %     ^     _     |
  109.      |  shf    !     @     #     "     |
  110.      |  on     )     ,     ?     =     |
  111.      +---------------------------------+
  112.  
  113. Orange-shifted keyboard:
  114.                   (screen)
  115.      | |_____________________________| |
  116.      |  ^a   ^b   ^c   ^d   ^e   ^f    |
  117.      |  ^g   ^h   ^i   ^j   ^k   ^l    |
  118.      |  ^m   ^n   ^o   ^p   ^q   ^r    |
  119.      |  ^s   ^t   ^u   ^v   ^w   ^x    |
  120.      |  < cr >    ^y   ^z   del  bs    |
  121.      |  alf    [     ]     {     }     |
  122.      |  ctl    <     >     ;     :     |
  123.      |  shf    \     |     '     `     |
  124.      |  on                      tab    |
  125.      +---------------------------------+ 
  126.  
  127. IV. Source code availability
  128.  
  129. I'm pretty embarassed about the condition of the source code, but I'll
  130.   post it to wuarchive soon.  I guess I have to pay for sloppy code 
  131.   by having everybody see it.  Hopefully it will be cleaned up by 
  132.   version 1.0.  
  133.  
  134.  
  135. V.  Random blathering
  136.  
  137. I think the idea of 'shareware' for calculator software of this scope is
  138.   ridiculous.  If you like NRTS, please send me mail saying so.  That will
  139.   certainly boost my ego and probably speed the release of version 1.0 :-)
  140.  
  141. I want to thank all of my betatesters, who kept me from making a total
  142.   fool out of myself by releasing extremely buggy software to the world.
  143.  
  144. If this documentation is unclear or appears to be in error, or (heaven 
  145.   forbid!) my code is not totally bug-free, please let me know by posting 
  146.   or through email.  One small thing we do know about: if you hit the ON
  147.   key while in the program, the next keystroke will exit the program and 
  148.   leave two system binaries <70h> on the stack.  No big deal, but it
  149.   is inconsistent and I'm sorry I can't figure out how to fix it, since
  150.   the bug is rooted in the behaviour of the lastkey syseval which I don't
  151.   fully understand. 
  152.  
  153. VI.  Disclaimer and Copyright Notice
  154.  
  155.       NRTS is (C) Copyright 1990 Bill Gribble
  156.  
  157.       Noncommercial distribution allowed, provided that this
  158.       copyright message is preserved, and any modified versions
  159.       are clearly marked as such.  
  160.  
  161.       NRTS makes use of undocumented low-level features of
  162.       the HP48SX calculator, and may or may not cause loss of data,
  163.       excessive battery drainage, and/or damage to the calculator
  164.       hardware.  The Author takes no responsibility whatsoever for 
  165.       any damage caused by the use of this program.
  166.  
  167.       THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
  168.       IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  169.       WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
  170.       PURPOSE.
  171.  
  172. *****************************************************************************
  173. **   Bill Gribble                     Harvey Mudd College, Claremont, CA   **
  174. **   bgribble@jarthur.claremont.edu   Never heard of it?  You're stupid.   **
  175. *****************************************************************************
  176.  ; NRTS 0.4:  Under-construction machine/rpl terminal emulator. 
  177.  
  178.     data.b    'H'            ; download preamble
  179.     data.b    'P'
  180.     data.b    'H'
  181.     data.b    'P'
  182.     data.b    '4'
  183.     data.b    '8'
  184.     data.b    '-'
  185.     data.b    'D'
  186.  
  187.  ; ROM addresses:
  188.  
  189.         save_regs=#0679b
  190.         restore_regs=#067d2
  191.         push_r0_shortint=#06537
  192.         alloc_str=#05b7d
  193.  
  194.  ; RAM addresses:
  195.  
  196.         loc_menugrob=#70551
  197.         loc_stackgrob=#70556
  198.         serbuf_len=#703fc 
  199.         annunc=#706c4        ; nibble for annunciator on/off
  200.  
  201.  ; Program execution starts here
  202.  
  203.     data.a  #02d9d       ; BEGIN rts
  204.         data.a  #64cca       ;   short_70 (mark for drop to mark code) 
  205.         data.a  #2eb62       ;   create iopar
  206.         data.a  #02dcc       ;   ml: init_shit
  207.  
  208.  ; store initial prog registers 
  209.  
  210. stinit: data.a  eninit-stinit
  211.         call.a  save_regs 
  212.         call.4  clscr
  213.         clr.w   a                ; scratch register
  214.         move.w  a,r1             ; now r1 is set
  215.         clr.w   a                ; setting r2
  216.         move.p5 loc_stackgrob,c
  217.         move.a  c,d1
  218.         move.a  @d1,a            ; get address of stack grob 
  219.         add.a   #a,a
  220.         add.a   #a,a
  221.         move.w  a,r2            
  222.         clr.w   a
  223.         move.w  a,r3
  224.         call.a  restore_regs
  225.         call.4  save_progregs
  226.         move.a  @d0,a            ; return to system
  227.         add.a   5,d0
  228.         jump.a  @a
  229. eninit:
  230.  
  231.  ; End machine language (init_shit)
  232.  
  233.         data.a  #071a2           ;   do_begin
  234.  
  235.         data.a  #02dcc           ;   ml: clear_to_mark
  236.  
  237. cmstar: data.a  cmend-cmstar     
  238. cmref1: move.a  @d1,a
  239.         move.p5 #64cca,c         ;   looking for <70h>
  240.         breq.a  c,a,cmlpen
  241.         add.a   5,d1
  242.         inc.a   d
  243.         jump.3  cmref1
  244. cmlpen: move.a  @d0,a            
  245.         add.a   5,d0              
  246.         jump.a  @a               
  247. cmend:
  248.  
  249.  ; End machine code (clear_to_mark)
  250.  
  251.         data.a  #04714           ;     lastkey: check for keypress
  252.         data.a  #61ad8           ;     if_then_else      
  253.         data.a  #02d9d           ;     BEGIN out_char
  254.         data.a  #3fe44           ;       KEY syseval stuff
  255.         data.a  #64bd0
  256.         data.a  #03eb1           ;       And_short_short
  257.         data.a  #03ff9           ;       Short_1        
  258.         data.a  #41d92
  259.         data.a  #2af60           ;       ip - now stack1=real key#
  260.         data.a  #18cea           ;       real_to_short
  261.         data.a  #02dcc           ;       mcode (convert_key)
  262.  
  263.  ; convert short for key pressed to short for character.  Return true for
  264.  ;  a sending character, false for an alpha-character, false and <1h>
  265.  ;  short for a shift, control, or alpha-key.
  266.  
  267. ck_beg: data.a  ck_end-ck_beg    ; object size
  268.         call.4  restore_progregs
  269.         move.a  @d1,a            ; copy key number to reg a
  270.         swap.a  d1,a
  271.         add.a   5,d1
  272.         move.a  @d1,c            ; c gets key number
  273.         push.a  c
  274.         swap.a  d1,a             ; pop stack 
  275.         add.a   5,d1
  276.         inc.a   d
  277.         call.a  save_regs
  278.         pop.a   c
  279.         move.a  c,b              ; b gets key number
  280.         move.w  r1,c             ; c gets registers
  281.         move.p5 #51,a
  282.         brne.a  a,b,nsk          ; not shift key
  283.         jump.4  shfkey
  284.    nsk: move.p5 #47,a
  285.         brne.a  a,b,nck          ; not control key
  286.         jump.4  cntkey
  287.    nck: move.p5 #3d,a              
  288.         brne.a  a,b,nak          ; now we know it's not shf, cnt, or alf key
  289.         jump.4  alfkey            
  290.    nak: brbc    #2,c,akns        ; alpha bit set
  291.         jump.4  alfset
  292.   akns: brbc    #3,c,slns        ; shift lock not set
  293.         jump.4  sflset 
  294.   slns: brbc    #0,c,sns         ; shift not set
  295.         jump.4  shfset
  296.    sns: brbc    #1,c,cns         ; control not set
  297.         jump.4  cntset       
  298.    cns: move.p1 #8,a
  299.         jump.4  offset
  300.  
  301. shfkey: brbc    #3,c,nsoff          ; toggle shift flags, push 0, false, and
  302.         clrb    #3,c                ;   exit.
  303.         clrb    #0,c
  304.         move.p1 #8,a
  305.         jump.3  kdone
  306.  nsoff: brbc    #0,c,son         
  307.         clrb    #0,c
  308.         setb    #3,c
  309.         move.p1 #a,a
  310.         jump.3  kdone
  311.    son: setb    #0,c
  312.         move.p1 #a,a
  313.  
  314.  kdone: move.w  c,r1
  315.         move.p5 annunc,c          ; set annunciators properly
  316.         move.a  c,d0
  317.         move.1  0,p
  318.         move.p  a,@d0
  319.         move.p5 #1,a
  320.         move.a  a,r0
  321.         call.a  push_r0_shortint
  322.         call.a  restore_regs
  323.         call.4  save_progregs
  324.         jump.4  false_rplret
  325.  
  326. cntkey: brbc    #1,c,ncoff
  327.         clrb    #1,c
  328.         move.p1 #8,a
  329.         jump.3  kdone
  330.  ncoff: setb    #1,c
  331.         move.p1 #9,a
  332.         jump.3  kdone
  333.         
  334. alfkey: brbc    #2,c,naoff
  335.         clrb    #2,c
  336.         move.p1 #8,a
  337.         jump.3  kdone
  338.  naoff: setb    #2,c
  339.         move.p1 #c,a
  340.         jump.3  kdone
  341.  
  342. sflset: move.p5 #64,a               ; shift character but don't 
  343.         add.a   a,b                 ; change flags
  344.         move.p1 #a,a
  345.         jump.3  offset
  346.  
  347. shfset: move.p5 #64,a
  348.         add.a   a,b
  349.         clrb    #0,c
  350.         move.w  c,r1
  351.         move.p1 #8,a
  352.         jump.3  offset
  353.  
  354. cntset: move.p5 #c8,a
  355.         add.a   a,b
  356.         clrb    #1,c
  357.         move.p1  #8,a
  358.         move.w  c,r1
  359.         jump.3  offset
  360.  
  361. alfset: move.w  r1,c
  362.         clrb    #2,c
  363.         move.1  0,p
  364.         move.p5 annunc,a
  365.         move.a  a,d0
  366.         move.p1 #8,a
  367.         move.p  a,@d0
  368.         move.w  c,r1
  369.         clr.w   c
  370.         move.a  b,c
  371.         move.p2 #3d,a                     ; do func-key cases in machine code
  372.         brgt.b  c,a,afref1
  373.         jump.3  afref2
  374. afref1: move.p2 #3e,a
  375.         brne.b  c,a,afref3
  376.         move.p5 #00101,c
  377.         jump.3  afref2
  378. afref3: move.p2  #3f,a
  379.         brne.b  c,a,afref4
  380.         move.p5 #00102,c
  381.         jump.3  afref2
  382. afref4: move.p2  #40,a
  383.         brne.b  c,a,afref5
  384.         move.p5 #00103,c
  385.         jump.3  afref2
  386. afref5: move.p2  #41,a
  387.         brne.b  c,a,afref6
  388.         move.p5 #00104,c
  389.         jump.3  afref2
  390. afref6: move.p2  #48,a
  391.         brne.b  c,a,afref7
  392.         move.p5 #00105,c
  393.         jump.3  afref2
  394. afref7: move.p2  #49,a
  395.         brne.b  c,a,afref8
  396.         move.p5 #00106,c
  397.         jump.3  afref2
  398. afref8: move.p2  #4a,a
  399.         brne.b  c,a,afref9
  400.         move.p5 #00107,c
  401.         jump.3  afref2
  402. afref9: move.p2  #4b,a
  403.         brne.b  c,a,afrefa
  404.         move.p5 #00108,c
  405.         jump.3  afref2
  406. afrefa: move.p2  #52,a
  407.         brne.b  c,a,afrefb
  408.         move.p5 #00109,c
  409.         jump.3  afref2
  410. afrefb: move.p2  #53,a
  411.         brne.b  c,a,afrefc
  412.         move.p5 #0010a,c
  413.         jump.3  afref2
  414. afrefc: move.p2  #54,a
  415.         brne.b  c,a,afrefd
  416.         move.p5 #0010b,c
  417.         jump.3  afref2
  418. afrefd: move.p2  #55,a
  419.         brne.b  c,a,afrefe
  420.         move.p5 #0010c,c
  421.         jump.3  afref2
  422. afrefe: move.p2  #5c,a
  423.         brne.b  c,a,afreff
  424.         move.p5 #0010d,c
  425.         jump.3  afref2
  426. afreff: move.p2  #5d,a
  427.         brne.b  c,a,afrefg
  428.         move.p5 #0010e,c
  429.         jump.3  afref2
  430. afrefg: move.p2  #5e,a
  431.         brne.b  c,a,afrefh
  432.         move.p5 #0010f,c
  433.         jump.3  afref2
  434. afrefh: move.p2  #5f,a
  435.         brne.b  c,a,afref2
  436.         move.p5 #00110,c
  437.         jump.3  afref2
  438.  
  439. afref2: move.a  c,r0
  440.         call.a  push_r0_shortint
  441.         call.4  save_progregs
  442.         jump.4  false_rplret
  443.                
  444. offset: clr.w   c
  445.         move.a  b,c                 ; c gets key value
  446.         move.a  c,r0
  447.         move.1  0,p
  448.         move.p5 annunc,c
  449.         move.a  c,d0
  450.         move.p  a,@d0
  451.         call.a  restore_regs        ; restore pointers
  452.         call.a  push_r0_shortint
  453.         call.4  save_progregs        
  454.         jump.4  true_rplret
  455.  
  456. ck_end:
  457.  
  458.  ; End machine language (convert_key)
  459.  
  460.         data.a  #61ad8           ;       if_then_else
  461.         data.a  #02d9d           ;       BEGIN (sending character)
  462.         data.a  #02dcc           ;         ml: get_key_string
  463.  
  464.  ; Take short key value and return a string to send
  465.  
  466. kstrst: data.a  kstren-kstrst    ; object size
  467.         call.a  save_regs
  468.         move.a  @d1,a            ; get data from level 1(short) to a
  469.         swap.a  d1,a                    
  470.         add.a   5,d1
  471.         move.a  @d1,c       
  472.         push.a  c
  473.         move.p5 2,c               ; size of string=1 byte
  474.         call.a  alloc_str         ; r0=header, d0=data
  475.         pop.a   c
  476.         move.a  c,a
  477.         move.p5 keytab-ref1,c     ; offset from read point
  478.         add.a   a,a               ; number of nibbles after keytab
  479.         add.a   a,c               ; c has total offset from ref1
  480.         move.a  pc,a              ; load pc to a 
  481. ref1:   add.a   c,a               ; add offset value
  482.         move.a  a,d1              ; point at it
  483.         move.b  @d1,c             ; c gets ascii value from keytab
  484.         move.b  c,@d0             ; put ascii in string
  485.         call.a  restore_regs      ; get old d0,d1,b,d
  486.         move.a  r0,a              ; load address of string
  487.         move.a  a,@d1             ; push string on stack & replace short
  488.         move.a  @d0,a             ; return to system
  489.         add.a   5,d0
  490.         jump.a  @a
  491. kstren:        
  492.  ; End of machine code (get_key_string)
  493.  
  494.         data.a  #2ee6f           ;         xmit
  495.         data.a  #03244           ;         drop (the 1 or zero)
  496.         data.a  #0312b           ;       END (sending character)
  497.         data.a  #02d9d           ;       BEGIN (alpha character)
  498.         data.a    #2378d           ;         case
  499.         data.a  #02d9d           ;         begin
  500.  
  501.         data.a  #03188           ;           dup
  502.         data.a  #0414d           ;           short_23h (alpha-q)
  503.         data.a  #1e761           ;           same
  504.         data.a  #237a8           ;           then
  505.         data.a  #02d9d           ;           PRG
  506.         data.a  #03244           ;             drop
  507.         data.a  #02dcc           ;             ml: set_quit
  508.  
  509.  ; Set quit bit of registers
  510. stquit: data.a  enquit-stquit  
  511.         call.4  restore_progregs
  512.         move.w  r1,c
  513.         setb    #4,c
  514.         move.w  c,r1
  515.         call.4  save_progregs
  516.         move.a  @d0,a
  517.         add.a   5,d0
  518.         jump.a  @a
  519. enquit:
  520.  ; End machine language (set_quit)
  521.  
  522.         data.a  #21ed5           ;             closeio
  523.         data.a  #0312b           ;           END (quit-key)
  524.  
  525. ; function keys run until ENDFNK
  526.  
  527.         data.a  #22fd5           ;           end quit-case
  528.  
  529.         data.a  #03188           ;           dup
  530.         data.a  #04071           ;           short_d (C)
  531.         data.a  #1e761           ;           same
  532.         data.a  #237a8           ;           then
  533.         data.a  #02d9d           ;           BEGIN (toggle cr/lf)
  534.         data.a  #03244           ;             drop
  535.         data.a  #02dcc           ;             mcode toggle_cr/lf
  536. tgclbg: data.a  tgclen-tgclbg 
  537.         call.4  restore_progregs
  538.         move.w  r1,a
  539.         brbs    #7,a,lfison
  540.         setb    #7,a
  541.         jump.3  crlfdn
  542. lfison: clrb    #7,a
  543. crlfdn: move.w  a,r1
  544.         call.4  save_progregs
  545.         move.a  @d0,a
  546.         add.a   5,d0
  547.         jump.a  @a
  548. tgclen:
  549.  
  550.   ; End machine code (toggle cr/lf)
  551.  
  552.         data.a  #0312b           ;           END (toggle cr/lf)
  553.         data.a  #22fd5           ;           end toggle-case
  554.  
  555.         data.a  #03188           ;           dup
  556.         data.a  #04157           ;           short_24
  557.         data.a  #1e761           ;           same
  558.         data.a  #237a8           ;           then
  559.         data.a  #02d9d           ;           BEGIN (kermit receive)
  560.         data.a  #03244           ;             drop
  561.         data.a  #21f96           ;             cmd_recv
  562.         data.a  #0312b           ;           END (kermit receive)
  563.         data.a  #22fd5           ;           end receive-case
  564.  
  565.         data.a  #03188           ;           dup
  566.         data.a  #04067           ;           short_ch
  567.         data.a  #1e761           ;           same
  568.         data.a  #237a8           ;           then
  569.         data.a  #02d9d           ;           BEGIN (serial break)
  570.         data.a  #03244           ;             drop
  571.         data.a  #220c2           ;             cmd_SBRK
  572.         data.a  #0312b           ;           END (serial break)
  573.         data.a  #22fd5           ;           end break-case
  574.  
  575.         data.a  #03188           ;           dup
  576.         data.a  #04189           ;           short_29h
  577.         data.a  #1e761           ;           same
  578.         data.a  #237a8           ;           then
  579.         data.a  #02d9d           ;           BEGIN (kermit send)
  580.         data.a  #03244           ;             drop
  581.         data.a  #21ef0           ;             cmd_SEND
  582.         data.a  #0312b           ;           END (kermit send)
  583.         data.a  #22fd5           ;           end send-case
  584.  
  585.         data.a  #02d9d           ;           BEGIN  (test clause)
  586.         data.a  #03188           ;             dup
  587.         data.a  #64e32           ;             short_100
  588.         data.a  #03d83           ;             greater_shortshort
  589.         data.a  #5380e           ;             T/F to real
  590.         data.a  #0312b           ;           END (test clause)     
  591.         data.a  #237a8           ;           then
  592.         data.a  #02d9d           ;           BEGIN (fn key #1)
  593.         data.a  #64e32           ;             short_100h
  594.         data.a  #03de0           ;             -_1short_2short
  595.         data.a  #23654           ;             open single quote (?)
  596.         data.a  #02e48           ;             global 'FKEYS'
  597.         data.b  #5
  598.         data.b  'F'
  599.         data.b  'K'
  600.         data.b  'E'
  601.         data.b  'Y'
  602.         data.b  'S'
  603.         data.a  #23679
  604.         data.a  #03223           ;             swap
  605.         data.a  #18dbf           ;             short_to_real
  606.         data.a  #1d7c6           ;             cmd_get
  607.         data.a  #1a3be           ;             cmd_eval
  608.         data.a  #0312b           ;           END (func key case)
  609.         data.a  #22fd5           ;           end function case
  610.  
  611.         data.a  #0312b           ;         END cases
  612.         data.a  #22fd5           ;         end case statement  
  613.         data.a  #0312b           ;       END (alpha character)
  614.         data.a  #0312b           ;     END out_char
  615.         data.a  #02d9d           ;     BEGIN in_char
  616.         data.a  #3133b           ;       buflen
  617.  
  618.         data.a  #02dcc           ;       ml: ser_buf_notempty
  619.  
  620.  ; check serial buffer status
  621.  
  622. sbnest: data.a  sbneen-sbnest    ; size of object
  623.         add.a   5,d1
  624.         inc.a   d
  625.         call.a  save_regs
  626.         move.a  @d1,a
  627.         add.a   5,a
  628.         move.a  a,d1
  629.         move.a  @d1,c
  630.         brz.b   c,bufemp         ; if something's there
  631.         call.a  restore_regs
  632.         jump.4  true_rplret      ; push true and exit
  633. bufemp: call.a  restore_regs
  634.         jump.4  false_rplret     ; nothing's there, push false and exit
  635. sbneen:
  636.  
  637.  ; End machine language (ser_buf_notempty)
  638.  
  639.         data.a  #61ad8           ;       if_then_else          
  640.         data.a  #02d9d           ;       BEGIN recv_char
  641.         data.a  #314e5           ;         srecv
  642.         data.a  #02d9d           ;         BEGIN deal_with_string
  643.         data.a  #03244           ;           drop (the true/false)
  644.  
  645.         data.a  #02dcc           ; ml: deal_with_rcvchar
  646. drcstr: data.a  drcend-drcstr    ; length of code object
  647.         call.4  restore_progregs        
  648.         move.a  @d1,a
  649.         swap.a  a,d1
  650.         add.a   #5,d1             ; skip type
  651.         move.a  @d1,c             ; get length
  652.         sub.a   #5,c              ; subtract length of length
  653.         srb.w   c                 ; divide by 2 
  654.         add.a   #5,d1             ; d1 points to start of data
  655.         swap.a  d1,a              ; now c.a has string length, 
  656.         move.a  a,d0              ; a.a and d0 point to data   
  657.         sln.w   a
  658.         sln.w   a
  659.         move.b  c,a             
  660.         move.w  a,r3              ; now we're ready to start looping
  661.         clr.w   a
  662.  
  663. loopst: move.b  @d0,a
  664.         clrb    #7,a              ; vt100 characters are 7-bit             
  665.         move.p2 #20,c
  666.         brle.b  c,a,iwchar
  667.         clr.a   c
  668.         move.a  a,c               ; multiply a by 5 to get nibble offset
  669.         add.a   c,c
  670.         add.a   c,c               ; c = 4 * a
  671.         add.a   c,a               ; offset from ctltab
  672.         move.p5 ctltab-drref4,c   ; offset from jump point to ctltab 
  673.         add.a   c,a               
  674.         move.a  pc,c              ; off. from top of mem to jump pt
  675. drref4: add.a   c,a               ; absolute address of data
  676.         move.a  a,d1
  677.         move.a  @d1,a             ; offset from drref4 to code
  678.         add.a   c,a               ; absolute address of code 
  679.         jump.a  a                 ; execute the code
  680.  
  681. iwchar: call.4  write_a
  682.         call.4  right_1           ; move right
  683.         brcs    drref1            ; if at end of line, newline
  684.         jump.3  donewc 
  685. drref1: call.4  carret    
  686.         call.4  down_1 
  687.         brcs    drref2            ; if on last line, scroll.
  688.         jump.3  donewc
  689. drref2: call.4  scroll_up               
  690.  
  691. donewc: move.w  r3,a              
  692.         move.b  a,c               ; get length to c
  693.         srn.w   a                 ; and pointer to a
  694.         srn.w   a
  695.         dec.b   c                 ; decrement length 
  696.         swap.w  a,b               ; stash pointer in b
  697.         brz.b   c,donews          ; if length < 1, we're done
  698.         swap.w  a,b               ; else put pointer back in a
  699.         add.a   #2,a              ; skip to next character
  700.         move.a  a,d0              ; point at it 
  701.         sln.w   a                 ; get ready to move to r3
  702.         sln.w   a
  703.         move.b  c,a
  704.         move.w  a,r3
  705.         clr.w   a
  706.         jump.3  loopst
  707. donews: swap.w  a,b
  708.         call.a  restore_regs
  709.         call.4  save_progregs
  710.         add.a   5,d1
  711.         inc.a   d
  712.         move.a  @d0,a
  713.         add.a   5,d0
  714.         jump.a  @a
  715.  
  716. ; graphics subroutines: write, move, scroll.
  717.  
  718. write_a:
  719.         move.p2 #20,c
  720.         sub.b   c,a             ; get right char number to a
  721.         sln.w   a               ; multiply by 16 for offset from fontab:
  722.         move.p5 fontab-waref1,c ; off from jump point to fontab
  723.         add.a   c,a             ; a has offset from jump to bitmap
  724.         move.a  pc,c
  725. waref1: add.a   c,a             ; a has absolute address of data
  726.         move.a  a,d1
  727.         move.w  @d1,c           ; c has character bitmap
  728.         move.p16 #0c0c0c0c0c0c0c0c,a
  729.         move.w  a,b
  730.         move.w  r1,a
  731.         brbc    #6,a,waref4
  732.         move.p16 #3030303030303030,a
  733.         move.w  a,b
  734.         call.4  flip_c
  735.         srb.w   c
  736.         srb.w   c        
  737.         call.4  flip_c
  738. waref4: move.w  c,d             ; get it out of the way.
  739.         move.a  r2,a            ; get current bitmap pointer
  740.         move.a  a,d0            ; stick it in d0
  741.         move.1  #f,p            ; p will be our loop counter       
  742. waref2: move.p  @d0,c           ; get nibble of screen
  743.         dec.1   p   
  744.         add.a   1,d0                   
  745.         move.p  @d0,c            ; get another nibble
  746.         and.w   b,c              ; mask data where we're looking
  747.         or.w    d,c              ; -or- with font bitmap
  748.         move.p  c,@d0            ; write nibble to screen
  749.         inc.1   p               
  750.         sub.a   1,d0
  751.         move.p  c,@d0            ; write second nibble to screen
  752.         add.a   #f,d0            ; move to next scan line
  753.         add.a   #f,d0
  754.         add.a   #4,d0
  755.         breq.1  p,2,waref3
  756.         breq.1  p,1,waref3       ; if we're done with character
  757.         breq.1  p,0,waref3
  758.         dec.1   p                ; move to next byte of data
  759.         dec.1   p
  760.         jump.4  waref2
  761. waref3: move.1  0,p              ; character's written; now move pointer
  762.         ret
  763.          
  764. ctllf:  call.4  carret    
  765.         call.4  down_1 
  766.         brcs    lfref1            ; if on last line, scroll.
  767.         jump.3  donewc
  768. lfref1: call.4  scroll_up               
  769.         jump.4  donewc
  770.  
  771. ctlcr:  call.4  carret
  772.         move.w  r1,a
  773.         brbc    #7,a,ccrrf2
  774.         call.4  down_1
  775.         brcs    ccrrf1
  776.         jump.3  donewc
  777. ccrrf1: call.4  scroll_up
  778. ccrrf2: jump.4  donewc
  779.  
  780. ctlbs:  call.4  left_1
  781.         jump.4  donewc
  782.  
  783. nopctl: jump.4  donewc
  784.  
  785. carret: call.4  left_1
  786.         brcc    carret
  787.         retclrc
  788.         
  789. flip_c: 
  790.         move.1  0,p
  791. fcref1: clr.a   a
  792.         add.a   3,a
  793. fcref2: dec.a   a
  794.         brz.a   a,fcref3
  795.         add.p   c,c
  796.         brcc    fcref2
  797.         add.p   1,c
  798.         jump.3  fcref2
  799. fcref3: breq.1  p,#f,fcref4
  800.         inc.1   p
  801.         jump.3  fcref1
  802. fcref4: move.1  0,p
  803.         ret
  804.                      
  805. right_1:
  806.         move.w  r2,c
  807.         move.a  c,b              ; b has display pointer
  808.         srn.w   c
  809.         srn.w   c
  810.         srn.w   c
  811.         srn.w   c
  812.         srn.w   c
  813.         move.p3 #15,a
  814.         brlt.b  c,a,mrref1      
  815.         retsetc
  816. mrref1: inc.b   c
  817.         sln.w   c
  818.         sln.w   c
  819.         sln.w   c
  820.         sln.w   c
  821.         sln.w   c
  822.         move.a  b,c
  823.         move.w  r1,a
  824.         brbs    #6,a,mrref2
  825.         inc.a   c
  826.         setb    #6,a
  827.         jump.3  mrref3
  828. mrref2: add.a   2,c
  829.         clrb    #6,a
  830. mrref3: move.w  a,r1
  831.         move.w  c,r2
  832.         retclrc
  833.  
  834. left_1: 
  835.         move.w  r2,c
  836.         move.a  c,b              ; b has display pointer
  837.         srn.w   c
  838.         srn.w   c
  839.         srn.w   c
  840.         srn.w   c
  841.         srn.w   c
  842.         brnz.b  c,mlref1      
  843.         retsetc
  844. mlref1: dec.b   c
  845.         sln.w   c
  846.         sln.w   c
  847.         sln.w   c
  848.         sln.w   c
  849.         sln.w   c
  850.         move.a  b,c
  851.         move.w  r1,a
  852.         brbc    #6,a,mlref2
  853.         dec.a   c
  854.         clrb    #6,a
  855.         jump.3  mlref3
  856. mlref2: sub.a   #2,c
  857.         setb    #6,a
  858. mlref3: move.w  a,r1
  859.         move.w  c,r2
  860.         retclrc
  861.  
  862. down_1: 
  863.         move.1  0,p
  864.         move.w  r2,c
  865.         move.a  c,b              ; b has display pointer, column
  866.         srn.w   c
  867.         srn.w   c
  868.         srn.w   c
  869.         srn.w   c
  870.         srn.w   c
  871.         sln.w   b
  872.         sln.w   b
  873.         move.b  c,b
  874.         srn.w   c
  875.         srn.w   c
  876.         move.p1 #6,a
  877.         brlt.p  c,a,mdref1 
  878.         breq.p  c,a,mdref2       
  879.         retsetc
  880. mdref1: inc.p   c            
  881.         sln.w   c            
  882.         sln.w   c
  883.         move.b  b,c
  884.         srn.w   b
  885.         srn.w   b
  886.         sln.w   c
  887.         sln.w   c
  888.         sln.w   c
  889.         sln.w   c
  890.         sln.w   c
  891.         move.a  b,c
  892.         move.p5 #110,a
  893.         add.a   a,c
  894.         jump.3  mdref3
  895. mdref2: inc.p   c
  896.         sln.w   c
  897.         sln.w   c
  898.         move.b  b,c
  899.         srn.w   b
  900.         srn.w   b
  901.         sln.w   c
  902.         sln.w   c
  903.         sln.w   c
  904.         sln.w   c
  905.         sln.w   c
  906.         move.a  b,c
  907.         move.p5 loc_stackgrob,a
  908.         move.a  a,d1
  909.         move.a  @d1,a
  910.         move.a  a,b                 ; b points to stackgrob header
  911.         move.p5 #674,a              ; offset to line #6 (7th line)
  912.         add.a   a,b                 ; b points to start of line #6
  913.         subn.a  c,b                 ; b has offset from start of #6  
  914.         move.p5 loc_menugrob,a
  915.         move.a  a,d1
  916.         move.a  @d1,a
  917.         add.a   #a,a
  918.         add.a   #a,a                ; a points to menugrob data
  919.         add.a   b,a                 ; a points to 8th line
  920.         move.a  a,c                 ; c.a points to 8th line
  921. mdref3: move.w  c,r2
  922.         retclrc
  923.  
  924. scroll_up:
  925. supst:  move.p5 loc_stackgrob,a
  926.         move.a  a,d1
  927.         move.a  @d1,a
  928.         move.a  a,b
  929.         move.p5 #124,c           ; nibbles to start of second line
  930.         add.a   c,a
  931.         move.a  a,d1
  932.         move.a  b,a
  933.         move.a  a,d0
  934.         add.a   #a,d0
  935.         add.a   #a,d0
  936.         move.p5 #6c,c             ; words to copy
  937. suref1: move.w  @d1,a
  938.         move.w  a,@d0
  939.         add.a   #f,d1
  940.         add.a   #f,d0
  941.         dec.a   c
  942.         brnz.a  c,suref1          ; loop until done
  943.         move.12 @d1,a             ; finish off the last bit
  944.         move.12 a,@d0
  945.         add.a   #c,d0
  946.         move.p5 loc_menugrob,a
  947.         move.a  a,d1
  948.         move.a  @d1,a
  949.         move.a  a,d1
  950.         add.a   #a,d1
  951.         add.a   #a,d1              ; d1 points to start of menugrob data
  952.         move.p5 #12,c              ; words to copy
  953. suref2: move.w  @d1,a              ; get old region
  954.         move.w  a,@d0              ; copy it 
  955.         add.a   #f,d0
  956.         add.a   #f,d1
  957.         dec.a   c
  958.         brnz.a  c,suref2
  959.         move.p5 loc_menugrob,a     ; clear last line of display (menu grob)
  960.         move.a  a,d1
  961.         move.a  @d1,a
  962.         move.a  a,d1            ;   d1 points to header of graph grob
  963.         add.a   #a,d1
  964.         add.a   #a,d1           ;   d1 points to data
  965.         move.p5 #12,c           ;   number of data words
  966.         clr.w   a
  967. suref3: move.w  a,@d1           ;   clear 1 word
  968.         dec.a   c
  969.     add.a   #f,d1
  970.         brnz.a  c,suref3
  971.         ret
  972.  
  973. drcend:
  974.  
  975.  ; End of machine language (deal_with_rcvchar)
  976.  
  977.         data.a  #0312b           ;         END deal_with_string
  978.         data.a  #0312b           ;       END recv_char
  979.         data.a  #02d9d           ;       BEGIN 
  980.         data.a  #03244           ;         drop
  981.         data.a  #0312b           ;       END 
  982.         data.a  #0312b           ;     END in_char
  983.         data.a  #02dcc           ;     ml: quit_flag_set?
  984.  
  985. ; Check if quit flag has been set in previous loop.  If it has, push true.
  986. ;   If not, push false.
  987.  
  988. qfstar: data.a  qfsend-qfstar   ; object size
  989.         call.4  restore_progregs
  990.         call.4  save_progregs
  991.         move.w  r1,a
  992.         brbs    #4,a,qset
  993.         jump.4  false_rplret
  994. qset:   jump.4  true_rplret
  995. qfsend:
  996.  
  997. ; End machine language (quit_flag_set?)
  998.  
  999.         data.a    #071c8           ;   end?
  1000.         data.a  #02dcc           ;   ml: pseudo_code_data
  1001.  
  1002. dtstar: data.a  dtend-dtstar     ; length of data
  1003. dtref1: move.a  @d1,a
  1004.         move.p5 #64cca,c
  1005.         add.a   5,d1
  1006.         inc.a   d
  1007.         breq.a  c,a,dtlpen
  1008.         jump.3  dtref1
  1009. dtlpen: move.a  @d0,a            ; just jump back to rpl
  1010.         add.a   5,d0             ; 
  1011.         jump.a  @a               ; 
  1012.  
  1013.  ; start called subroutines.  move graphics routines here later.
  1014.  
  1015. clscr:  move.p5 loc_stackgrob,a
  1016.         move.a  a,d1
  1017.         move.a  @d1,a
  1018.         move.a  a,d1            ;   d1 points to header of graph grob
  1019.         add.a   #a,d1
  1020.         add.a   #a,d1           ;   d1 points to data
  1021.         move.p5 #7e,c           ;   number of data words
  1022.         clr.w   a
  1023. csref1: move.w  a,@d1           ;   clear 1 nibble
  1024.         dec.a   c
  1025.     add.a   #f,d1
  1026.         brnz.a  c,csref1
  1027.         move.11 a,@d1 
  1028.         move.p5 loc_menugrob,a
  1029.         move.a  a,d1
  1030.         move.a  @d1,a
  1031.         move.a  a,d1            ;   d1 points to header of graph grob
  1032.         add.a   #a,d1
  1033.         add.a   #a,d1           ;   d1 points to data
  1034.         move.p5 #12,c           ;   number of data words
  1035.         clr.w   a
  1036. csref2: move.w  a,@d1           ;   clear 1 word
  1037.         dec.a   c
  1038.     add.a   #f,d1
  1039.         brnz.a  c,csref2
  1040.         ret
  1041.  
  1042. save_progregs:
  1043.      call.a  save_regs
  1044.          move.p5 regs-spref1,a
  1045.          move.a  pc,c
  1046.  spref1: add.a   c,a
  1047.          move.a  a,d1
  1048.          move.w  r1,a
  1049.          move.w  a,@d1
  1050.          add.a   #10,d1
  1051.          move.w  r2,a
  1052.          move.w  a,@d1
  1053.          add.a   #10,d1
  1054.          move.w  r3,a
  1055.          move.w  a,@d1
  1056.          add.a   #10,d1
  1057.          move.w  r4,a
  1058.          move.w  a,@d1
  1059.          call.a  restore_regs
  1060.          ret
  1061.  
  1062. restore_progregs:
  1063.          call.a  save_regs
  1064.          move.p5 regs-rpref1,c
  1065.          move.a  pc,a
  1066.  rpref1: add.a   c,a
  1067.          move.a  a,d1
  1068.          move.w  @d1,a
  1069.          move.w  a,r1
  1070.          add.a   #10,d1
  1071.          move.w  @d1,a
  1072.          move.w  a,r2
  1073.          add.a   #10,d1
  1074.          move.w  @d1,a
  1075.          move.w  a,r3
  1076.          add.a   #10,d1
  1077.          move.w  @d1,a
  1078.          move.w  a,r4
  1079.          call.a  restore_regs
  1080.          ret
  1081.  
  1082. true_rplret:
  1083.          sub.a   5,d1
  1084.          dec.a   d
  1085.          move.p5 #3a81,a
  1086.          move.a  a,@d1
  1087.          move.a  @d0,a
  1088.          add.a   5,d0
  1089.          jump.a  @a
  1090.  
  1091. false_rplret:
  1092.          sub.a   5,d1
  1093.          dec.a   d
  1094.          move.p5 #3ac0,a
  1095.          move.a  a,@d1
  1096.          move.a  @d0,a
  1097.          add.a   5,d0
  1098.          jump.a  @a
  1099.  
  1100. regs:    data.w  0
  1101.      data.w  0
  1102.          data.w  0
  1103.          data.w  0
  1104.          data.w  0
  1105.  
  1106. keytab: 
  1107. ; key-number to ascii conversion table. 
  1108.  
  1109.         data.b  ' '
  1110.         data.b  ' '
  1111.         data.b  ' '
  1112.         data.b  ' '
  1113.         data.b  ' '
  1114.         data.b  ' '
  1115.         data.b  ' '
  1116.         data.b  ' '
  1117.         data.b  ' '
  1118.         data.b  ' '
  1119.         data.b  ' '
  1120.         data.b  'a'
  1121.         data.b  'b'
  1122.         data.b  'c'
  1123.         data.b  'd'
  1124.         data.b  'e'
  1125.         data.b  'f'
  1126.         data.b  ' '
  1127.         data.b  ' '
  1128.         data.b  ' '
  1129.         data.b  ' '
  1130.         data.b  'g'
  1131.         data.b  'h'
  1132.         data.b  'i'
  1133.         data.b  'j'
  1134.         data.b  'k'
  1135.         data.b  'l'
  1136.         data.b  ' '
  1137.         data.b  ' '
  1138.         data.b  ' '
  1139.         data.b  ' '
  1140.         data.b  'm'
  1141.         data.b  'n'
  1142.         data.b  'o'
  1143.         data.b  'p'
  1144.         data.b  'q'
  1145.         data.b  'r'
  1146.         data.b  ' '
  1147.         data.b  ' '
  1148.         data.b  ' '
  1149.         data.b  ' '
  1150.         data.b  's'
  1151.         data.b  't'
  1152.         data.b  'u'
  1153.         data.b  'v'
  1154.         data.b  'w'
  1155.         data.b  'x'
  1156.         data.b  ' '
  1157.         data.b  ' '
  1158.         data.b  ' '
  1159.         data.b  ' '
  1160.         data.b  #d      ; return
  1161.         data.b  'y'
  1162.         data.b  'z'
  1163.         data.b  #7f     ; delete
  1164.         data.b  #8      ; backspace
  1165.         data.b  ' '
  1166.         data.b  ' '
  1167.         data.b  ' '
  1168.         data.b  ' '
  1169.         data.b  ' '
  1170.         data.b  ' '     ; alpha - not used
  1171.         data.b  '7'
  1172.         data.b  '8'
  1173.         data.b  '9'
  1174.         data.b  '/'
  1175.         data.b  ' '
  1176.         data.b  ' '
  1177.         data.b  ' '
  1178.         data.b  ' '
  1179.         data.b  ' '
  1180.         data.b  ' '      ; shift - not used
  1181.         data.b  '4'
  1182.         data.b  '5'
  1183.         data.b  '6'
  1184.         data.b  '*'
  1185.         data.b  ' '
  1186.         data.b  ' '
  1187.         data.b  ' '
  1188.         data.b  ' '
  1189.         data.b  ' '
  1190.         data.b  ' '      ; blue-shift - not used
  1191.         data.b  '1'
  1192.         data.b  '2'
  1193.         data.b  '3'
  1194.         data.b  '-'
  1195.         data.b  ' '
  1196.         data.b  ' '
  1197.         data.b  ' '
  1198.         data.b  ' '
  1199.         data.b  ' '
  1200.         data.b  ' '
  1201.         data.b  '0'
  1202.         data.b  '.'
  1203.         data.b  ' '
  1204.         data.b  '+'
  1205.         data.b  ' '
  1206.     data.b  ' '
  1207.         data.b  ' '
  1208.         data.b  ' '
  1209.         data.b  ' '
  1210.         data.b  ' '          ; start shifted characters
  1211.         data.b  ' '
  1212.         data.b  ' '
  1213.         data.b  ' '
  1214.         data.b  ' '
  1215.         data.b  ' '
  1216.         data.b  ' '
  1217.         data.b  ' '
  1218.         data.b  ' '
  1219.         data.b  ' '
  1220.         data.b  'A'
  1221.         data.b  'B'
  1222.         data.b  'C'
  1223.         data.b  'D'
  1224.         data.b  'E'
  1225.         data.b  'F'
  1226.         data.b  ' '
  1227.         data.b  ' '
  1228.         data.b  ' '
  1229.         data.b  ' '
  1230.         data.b  'G'
  1231.         data.b  'H'
  1232.         data.b  'I'
  1233.         data.b  'J'
  1234.         data.b  'K'
  1235.         data.b  'L'
  1236.         data.b  ' '
  1237.         data.b  ' '
  1238.         data.b  ' '
  1239.         data.b  ' '
  1240.         data.b  'M'
  1241.         data.b  'N'
  1242.         data.b  'O'
  1243.         data.b  'P'
  1244.         data.b  'Q'
  1245.         data.b  'R'
  1246.         data.b  ' '
  1247.         data.b  ' '
  1248.         data.b  ' '
  1249.         data.b  ' '
  1250.         data.b  'S'
  1251.         data.b  'T'
  1252.         data.b  'U'
  1253.         data.b  'V'
  1254.         data.b  'W'
  1255.         data.b  'X'
  1256.         data.b  ' '
  1257.         data.b  ' '
  1258.         data.b  ' '
  1259.         data.b  ' '
  1260.         data.b  #d          ; return, even shifted
  1261.         data.b  'Y'
  1262.         data.b  'Z'
  1263.         data.b  #7f         ; del
  1264.         data.b  #8          ; bs
  1265.         data.b  ' '
  1266.         data.b  ' '
  1267.         data.b  ' '
  1268.         data.b  ' '
  1269.         data.b  ' '
  1270.         data.b  ' '
  1271.         data.b  '&'
  1272.         data.b  '*'
  1273.         data.b  '('
  1274.         data.b  '~'
  1275.         data.b  ' '
  1276.         data.b  ' '
  1277.         data.b  ' '
  1278.         data.b  ' '
  1279.         data.b  ' '
  1280.         data.b  ' '
  1281.         data.b  '$'
  1282.         data.b  '%'
  1283.         data.b  '^'
  1284.         data.b  '_'
  1285.         data.b  ' '
  1286.         data.b  ' '
  1287.         data.b  ' '
  1288.         data.b  ' '
  1289.         data.b  ' '
  1290.         data.b  ' '
  1291.         data.b  '!'
  1292.         data.b  '@'
  1293.         data.b  '#'
  1294.         data.b  '"'
  1295.         data.b  ' '
  1296.         data.b  ' '
  1297.         data.b  ' '
  1298.         data.b  ' '
  1299.         data.b  ' '
  1300.         data.b  ' '
  1301.         data.b  ')'
  1302.         data.b  #2c
  1303.         data.b  '?'
  1304.         data.b  '='
  1305.         data.b  ' '
  1306.         data.b  ' '
  1307.         data.b  ' '
  1308.         data.b  ' '
  1309.         data.b  ' '
  1310.         data.b  ' '      ; start of control characters
  1311.         data.b  ' '
  1312.         data.b  ' '
  1313.         data.b  ' '
  1314.         data.b  ' '
  1315.         data.b  ' '
  1316.         data.b  ' '
  1317.         data.b  ' '
  1318.         data.b  ' '
  1319.         data.b  ' '
  1320.         data.b  #01
  1321.         data.b  #02
  1322.         data.b  #03
  1323.         data.b  #04
  1324.         data.b  #05
  1325.         data.b  #06
  1326.         data.b  #0
  1327.         data.b  #0
  1328.         data.b  #0
  1329.         data.b  #0
  1330.         data.b  #07
  1331.         data.b  #08
  1332.         data.b  #09
  1333.         data.b  #0a
  1334.         data.b  #0b
  1335.         data.b  #0c
  1336.         data.b  #0
  1337.         data.b  #0
  1338.         data.b  #0
  1339.         data.b  #0
  1340.         data.b  #0d
  1341.         data.b  #0e
  1342.         data.b  #0f
  1343.         data.b  #10
  1344.         data.b  #11
  1345.         data.b  #12
  1346.         data.b  #0
  1347.         data.b  #0
  1348.         data.b  #0
  1349.         data.b  #0
  1350.         data.b  #13
  1351.         data.b  #14
  1352.         data.b  #15
  1353.         data.b  #16
  1354.         data.b  #17
  1355.         data.b  #18
  1356.         data.b  #0
  1357.         data.b  #0
  1358.         data.b  #0
  1359.         data.b  #0
  1360.         data.b  #0d
  1361.         data.b  #19
  1362.         data.b  #1a
  1363.         data.b  #7f
  1364.         data.b  #8
  1365.         data.b  #0
  1366.         data.b  #0
  1367.         data.b  #0
  1368.         data.b  #0
  1369.         data.b  #0
  1370.         data.b  #0
  1371.         data.b  '['
  1372.         data.b  ']'
  1373.         data.b  '{'
  1374.         data.b  '}'
  1375.         data.b  #0
  1376.         data.b  #0
  1377.         data.b  #0
  1378.         data.b  #0
  1379.         data.b  #0
  1380.         data.b  #0
  1381.         data.b  '<'
  1382.         data.b  '>'
  1383.         data.b  #3b
  1384.         data.b  #3a
  1385.         data.b  #0
  1386.         data.b  #0
  1387.         data.b  #0
  1388.         data.b  #0
  1389.         data.b  #0
  1390.         data.b  #0
  1391.         data.b  '\'
  1392.         data.b  '|'
  1393.         data.b  #27
  1394.         data.b  #60
  1395.         data.b  #0
  1396.         data.b  #0
  1397.         data.b  #0
  1398.         data.b  #0
  1399.         data.b  #0
  1400.         data.b  #0
  1401.         data.b  #0
  1402.         data.b  #0
  1403.         data.b  #0
  1404.         data.b  #9
  1405.         data.b  #0
  1406.  
  1407. fontab:
  1408.  
  1409. data.w  #0000000000000000
  1410. data.w  #4040404040004000
  1411. data.w  #A0A0A00000000000
  1412. data.w  #A0A0F1A0F1A0A000
  1413. data.w  #40E150E041F04000
  1414. data.w  #3031804020918100
  1415. data.w  #2050502051906100
  1416. data.w  #4040400000000000
  1417. data.w  #8040202020408000
  1418. data.w  #2040808080402000
  1419. data.w  #00A040F140A00000
  1420. data.w  #004040F140400000
  1421. data.w  #0000000060604020
  1422. data.w  #000000F100000000
  1423. data.w  #0000000000606000
  1424. data.w  #0001804020100000
  1425. data.w  #E01191513111E000
  1426. data.w  #406040404040E000
  1427. data.w  #E01101C02010F100
  1428. data.w  #E01101E00111E000
  1429. data.w  #80C0A090F1808000
  1430. data.w  #F110F0010111E000
  1431. data.w  #C02010F01111E000
  1432. data.w  #F101804020202000
  1433. data.w  #E01111E01111E000
  1434. data.w  #E01111E101806000
  1435. data.w  #0060600060600000
  1436. data.w  #0060600060604020
  1437. data.w  #8040201020408000
  1438. data.w  #0000F100F1000000
  1439. data.w  #1020408040201000
  1440. data.w  #E011018040004000
  1441. data.w  #E01151D15010E100
  1442. data.w  #E01111F111111100
  1443. data.w  #F01111F01111F000
  1444. data.w  #E01110101011E000
  1445. data.w  #7090111111907000
  1446. data.w  #F11010F01010F100
  1447. data.w  #F11010F010101000
  1448. data.w  #E01110109111E100
  1449. data.w  #111111F111111100
  1450. data.w  #E04040404040E000
  1451. data.w  #010101011111E000
  1452. data.w  #1190503050901100
  1453. data.w  #101010101010F100
  1454. data.w  #11B1515111111100
  1455. data.w  #1111315191111100
  1456. data.w  #E01111111111E000
  1457. data.w  #F01111F010101000
  1458. data.w  #E011111151906100
  1459. data.w  #F01111F050901100
  1460. data.w  #E01110E00111E000
  1461. data.w  #F140404040404000
  1462. data.w  #111111111111E000
  1463. data.w  #111111A0A0404000
  1464. data.w  #1111115151B11100
  1465. data.w  #1111A040A0111100
  1466. data.w  #1111A04040404000
  1467. data.w  #F10180402010F100
  1468. data.w  #E02020202020E000
  1469. data.w  #0010204080010000
  1470. data.w  #E08080808080E000
  1471. data.w  #40A0110000000000
  1472. data.w  #000000000000F100
  1473. data.w  #2020400000000000
  1474. data.w  #0000E001E111E100
  1475. data.w  #1010F0111111F000
  1476. data.w  #0000E1101010E100
  1477. data.w  #0101E1111111E100
  1478. data.w  #0000E011F110E000
  1479. data.w  #40A0207020202000
  1480. data.w  #0000E01111E101E0
  1481. data.w  #1010F01111111100
  1482. data.w  #400060404040E000
  1483. data.w  #8000C08080809060
  1484. data.w  #1010905030509000
  1485. data.w  #604040404040E000
  1486. data.w  #0000B05151511100
  1487. data.w  #0000F01111111100
  1488. data.w  #0000E0111111E000
  1489. data.w  #0000F01111F01010
  1490. data.w  #0000E11111E10101
  1491. data.w  #0000D13010101000
  1492. data.w  #0000E110E001F000
  1493. data.w  #2020702020A04000
  1494. data.w  #000011111111E100
  1495. data.w  #0000111111A04000
  1496. data.w  #000011115151A000
  1497. data.w  #000011A040A01100
  1498. data.w  #0000111111E101E0
  1499. data.w  #0000F1804020F100
  1500. data.w  #C02020102020C000
  1501. data.w  #4040404040404000
  1502. data.w  #6080800180806000
  1503. data.w  #0000205180000000
  1504.  
  1505. ctltab:
  1506.     data.a  nopctl-drref4      ; null
  1507.     data.a  nopctl-drref4
  1508.     data.a  nopctl-drref4
  1509.     data.a  nopctl-drref4
  1510.     data.a  nopctl-drref4
  1511.     data.a  nopctl-drref4      ; enquiry (next version?)
  1512.     data.a  nopctl-drref4
  1513.     data.a  nopctl-drref4      ; bell (next version?)
  1514.     data.a  ctlbs-drref4       ; backspace
  1515.     data.a  nopctl-drref4      ; tab
  1516.     data.a  ctllf-drref4       ; linefeed
  1517.     data.a  ctllf-drref4       ; linefeed 
  1518.     data.a  ctllf-drref4       ; linefeed 
  1519.     data.a  ctlcr-drref4       ; carriage return
  1520.     data.a  nopctl-drref4      ; char set shit
  1521.     data.a  nopctl-drref4      ; char set shit
  1522.     data.a  nopctl-drref4      ; hex #f
  1523.     data.a  nopctl-drref4      ; hex #10
  1524.     data.a  nopctl-drref4
  1525.     data.a  nopctl-drref4
  1526.     data.a  nopctl-drref4
  1527.     data.a  nopctl-drref4
  1528.     data.a  nopctl-drref4
  1529.     data.a  nopctl-drref4
  1530.     data.a  nopctl-drref4
  1531.     data.a  nopctl-drref4
  1532.     data.a  nopctl-drref4
  1533.     data.a  nopctl-drref4
  1534.     data.a  nopctl-drref4
  1535.     data.a  nopctl-drref4
  1536.     data.a  nopctl-drref4
  1537.     data.a  nopctl-drref4
  1538.     data.a  nopctl-drref4
  1539.     data.a  nopctl-drref4
  1540.     data.a  nopctl-drref4
  1541.     data.a  nopctl-drref4
  1542.     data.a  nopctl-drref4
  1543.     data.a  nopctl-drref4
  1544.  
  1545. dtend:
  1546.  
  1547.  ; End machine language (pseudo-code data)
  1548.  
  1549.         data.a  #0312b           ; END nrts 
  1550. %%HP: T(3)A(D)F(.);
  1551. "D9D20ACC4626BE2CCD20450008FB97608E42C0AF0101AF03465507135143818F
  1552. 09818F09102AF01038F2D7608E45C0142164808C2A170CCD207200014334ACC4
  1553. 68A2B0174E76BEF142164808C417408DA16D9D2044EF30DB461BE309FF3029D1
  1554. 406FA2AEC81CCD20FB3008EF1C014313317414706133174E78FB976007D51198
  1555. 0824150008A4808CE60080824740008A4808C7D0080824D30008A4808C7E0080
  1556. 8A2808C1510808A3808C2F00808A0808CBF00808A1808CC0108082088C0E2080
  1557. 8A36180883808808082086920808A061808808089380820A6E008089080820A1
  1558. 09344C607134201500808241000081AF008F735608F2D7608ECBA08C36B0808A
  1559. 1118088180820860BF8089180820961AF808A211808828082086B8F808928082
  1560. 0C6C7F8082446000C880820A61028082446000C88088010980820863E1808248
  1561. C000C88088180820810965C11198088220808244C6071308082081500109AF2D
  1562. 980821D39E260637180821E3966D034101006C5180821F3966D0342010065418
  1563. 082104966D034301006E218082114966D0344010067118082184966D03450100
  1564. 60018082194966D0346010069E080821A4966D0347010062D080821B4966D034
  1565. 801006BB08082125966D0349010064A08082135966D034A01006D80808214596
  1566. 6D034B010066708082155966D034C01006F5080821C5966D034D010068408082
  1567. 1D5966D034E0100613080821E5966D034F01006A1080821F5966D03401100630
  1568. 081AF088F735608EE5808C5090AF2D981AF0820344C60713415008F2D7608F73
  1569. 5608E92808C4B808DA16D9D20CCD20060008FB97601431331741470634200008
  1570. FD7B5007DA34EE800C4C281B4CA13114F14C8F2D76081AF10141142164808CF6
  1571. EE244230B2130D9D20D8732D9D2088130D4140167E18A732D9D2044230CCD206
  1572. 20008E0B70119808941098E7570142164808C5DE12B21305DF22881301704016
  1573. 7E18A732D9D2044230CCD20630008E857011180877B0808576800808471018EF
  1574. E60142164808CB21305DF228813075140167E18A732D9D204423069F12B21305
  1575. DF228813076040167E18A732D9D20442302C022B21305DF228813098140167E1
  1576. 8A732D9D20442300FE12B21305DF22D9D208813023E4638D30E0835B21308A73
  1577. 2D9D2023E460ED304563284E205064B45495359763232230FBD816C7D1EB3A1B
  1578. 21305DF22B21305DF22B2130B2130D9D20B3313CCD20F3000174E78FB9760143
  1579. 818F0413114796AF08F2D7608C52608F2D7608C43608DA16D9D205E413D9D204
  1580. 4230CCD20684008E6A50143133174147818FA481E174133130BF0BF0AEA103AF
  1581. 014A8084731029EE72D2D6C6C6CA3406E00CA81B5CA131143CA81B28EB7008EC
  1582. C104606C108E48108EF62046069008E4330113AE6BF4BF4A6EAFC96A12AFC818
  1583. F01130BF0BF0AEA103AF06B6FAFC8F2D7608E9840174E7142164808C3102B6AB
  1584. F034AC700CA81B5CA13115778082FC0C0C0C0C0C0C0C0AF811180866C28082F0
  1585. 303030303030303AF88E7C0081E81E8EBB00AF781AF121302F15600D16015600
  1586. E750E7F15400C180154016E16E1638926189111890C00D0D8C0CFF20018E4500
  1587. 8EF31046069DE8E40208CECEF8E530011180867518E611046060BE8EBD108C5A
  1588. EF8E6A008C99EF8C39EF8E490059F0320D0818F02CC8A821A0655F8180206CEF
  1589. 89F800C69DF200111AD5BF6BF6BF6BF6BF6808225109E64002B66BF2BF2BF2BF
  1590. 2BF2D911180876D0E6808566E00818F218084610110A0311AD5BF6BF6BF6BF6B
  1591. F696E4002A6EBF2BF2BF2BF2BF2D911180866D0CE808466E00818FA180856101
  1592. 10A032011AD5BF6BF6BF6BF6BF6BF1BF1AE5BF6BF6808206986909027302B06B
  1593. F2BF2AE9BF5BF5BF2BF2BF2BF2BF2D98082401100C26660B06BF2BF2AE9BF5BF
  1594. 5BF2BF2BF2BF2BF2D98082465507131143D88082447600C8ED80824155071311
  1595. 43818F09818F09C0D610A038082465507131143D83442100CA131D4130169169
  1596. 34C60001537150717E16ECE8AEDE15BB158B16B8082415507131143131179179
  1597. 34210001537150716E17ECE8AEDE80824155071311431311791793421000AF01
  1598. 517CE17E8AE4F01B2130B2130D9D2044230B2130B2130CCD20720008EDF008EF
  1599. A0011180874808CC4108CA2108C170CCD204AA0014334ACC46174E78A2606BEF
  1600. 142164808C808246550713114313117917934E7000AF01517CE17E8AE4F159A8
  1601. 0824155071311431311791793421000AF01517CE17E8AE4F018FB9760808240B
  1602. 00081B5CA131111151717F112151717F113151717F11415178F2D760018FB976
  1603. 034B600081B4CA131153710117F153710217F153710317F15371048F2D760011
  1604. C4CF8082418A30141142164808C1C4CF808240CA30141142164808C010000000
  1605. 0000000C7907000000000000000000000000000AA34AC634A051000000000000
  1606. 0000000020202020202020202020216263646566602020202768696A6B6C6020
  1607. 20202D6E6F60717270202020237475767778702020202D097A7F780020202020
  1608. 202738393F2020202020202435363A2020202020202132333D20202020202020
  1609. 3E202B202020202020202020202020202020214243444546402020202748494A
  1610. 4B4C402020202D4E4F40515250202020235455565758502020202D095A5F7800
  1611. 2020202020262A282E70202020202024252E5F50202020202021204322202020
  1612. 202020292C2F3D30202020202020202020202020202021020304050600000000
  1613. 0708090A0B0C000000000D0E0F00111210000000031415161718100000000D09
  1614. 1A1F780000000000000B5D5B7D7000000000000C3E3B3A3000000000000C5C77
  1615. 2060000000000000000009000000000000000000000040004040404040000000
  1616. 0000A0A0A000A0A1F0A1F0A0A00040F140E051E0400181902040813030016091
  1617. 50205050200000000000404040008040202020408000204080808040200000A0
  1618. 41F040A00000004041F0404000204060600000000000000001F0000000006060
  1619. 0000000000000010204081000000E11131519110E000E040404040604001F010
  1620. 20C10110E000E11100E10110E0008081F090A0C08000E1110100F011F000E111
  1621. 10F01020C000202020408101F000E11110E11110E000608101E11110E0000060
  1622. 600060600020406060006060000080402010204080000001F001F00000001020
  1623. 408040201000400040810110E001E01051D15110E001111111F11110E000F111
  1624. 10F11110F000E11010101110E0007091111110907001F01010F01011F0001010
  1625. 10F01011F001E11190101110E001111111F111111000E04040404040E000E111
  1626. 1101010100011090503050911001F0101010101010011111115151B110011111
  1627. 915131111000E11111111110E000101010F11110F001609151111110E0011090
  1628. 50F11110F000E11100E01110E000404040404041F000E1111111111110004040
  1629. A0A11111100111B15151111110011110A040A111100040404040A1111001F010
  1630. 20408101F000E02020202020E0000100804020100000E08080808080E0000000
  1631. 000110A04001F0000000000000000000000040202001E111E100E0000000F111
  1632. 1110F0101001E0101011E0000001E1111111E1010000E011F110E00000002020
  1633. 207020A040E101E11110E000000111111110F0101000E0404040600040609080
  1634. 8080C00080009050305090101000E04040404040600111515150B00000011111
  1635. 1110F0000000E1111110E000001010F11110F000010101E11111E00000001010
  1636. 1031D0000000F100E011E000000040A0202070202001E11111111000000040A1
  1637. 111110000000A15151111000000110A040A1100000E101E1111110000001F020
  1638. 4081F0000000C02020102020C000404040404040400060808100808060000000
  1639. 8150200005A1005A1005A1005A1005A1005A1005A1005A100991005A10015100
  1640. 1510015100071005A1005A1005A1005A1005A1005A1005A1005A1005A1005A10
  1641. 05A1005A1005A1005A1005A1005A1005A1005A1005A1005A1005A1005A1005A1
  1642. 005A100B2130DF33"
  1643.  
  1644.